package com.rabbit.executor;

import com.rabbit.handler.MyExecutorService;
import org.springframework.stereotype.Service;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * <h1>异步任务线程池</h1>
 *
 * @author zjw
 * @date 2022/1/14 9:20
 */
public class AsyncTask {

    /**
     * 业务通用线程池(使用前请自行评估poolSize并调整)
     */
    public static final ExecutorService COMMON_EXECUTOR = new MyExecutorService(10, 20, 30,
            TimeUnit.SECONDS, new LinkedBlockingQueue<>(1000), new ThreadPoolExecutor.AbortPolicy(), "通用线程池");

}
